package com.yonglian.management.repository;

import com.yonglian.management.domain.ActivityProperty;
import java.util.List;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Spring Data JPA repository for the ActivityProperty entity.
 */
@SuppressWarnings("unused")
@Repository
public interface ActivityPropertyRepository extends JpaRepository<ActivityProperty, Long> {
    List<ActivityProperty> findByActivityId(Long activityId);

    @Modifying
    @Transactional
    @Query("DELETE FROM activity_property p WHERE p.activity.id = :activityId and p.id NOT IN (:ids)")
    void deleteActivityPropertiesNotIn(@Param("activityId") Long activityId, @Param("ids") Long[] ids);
}
